using System;
using System.Web.Mvc;
using AutoMapper;
using WebApp.ModelService;
using WebApp.Services;

namespace WebApp.Controllers
{
    [Authorize]
    public class TrackLogController : SmartController
    {
        private readonly ITrackLogModelService _trackLogModelService;
        public TrackLogController(IUserSession userSession, IMappingEngine mappingEngine, ITrackLogModelService trackLogModelService)
            : base(userSession, mappingEngine)
        {
            _trackLogModelService = trackLogModelService;
        }

        public ActionResult Index()
        {
            var response = _trackLogModelService.GetPageBySpecification();
            return View(response);
        }

        public ActionResult Add()
        {
            var response = _trackLogModelService.GetTrackLogDetailById();
            return View(response);
        }

        [Authorize]
        public ViewResult Show(Guid id)
        {
            var response = _trackLogModelService.GetTrackLogDetailById(id);
            return View(response);
        }

        [Authorize]
        public ViewResult Edit(Guid id)
        {
            var response = _trackLogModelService.GetTrackLogDetailById(id);
            return View(response);
        }
    }
}